﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Forest.Cat.Domain;
using Forest.Cat.Domain.Services.Catalog;
using Forest.Cat.Domain.Shared;
using Forest.Cat.Web.Extensions;

namespace Forest.Cat.Web.Controllers {
    public class FairController : Controller {
        private readonly IWorkContext _workContext;
        private readonly INewsService _newsService;

        public FairController(IWorkContext workContext, INewsService newsService) {
            this._workContext = workContext;
            this._newsService = newsService;
        }

        public ActionResult Index() {
            var items = _newsService.GetNewByTab(NewsTab.Fair,20).ToList().Select(x => x.ToModel());
            return View(items);
        }

    }
}
